
class OutClass{
    public int data1=10;
    private int data2=20;
    public static int data3=30;
    class InnerClass{
        public int data4=40;
        private int data5=50;
        public static final int data6=60;//内部类中定义静态变量要加fina

        public void textInner(){
            System.out.println("textInner");
            System.out.println(data1);
            System.out.println(data2);
            System.out.println(data3);
            System.out.println(data4);
            System.out.println(data5);
            System.out.println(data6);


        }
    }
}
public class Text {
    //实例内部类
    public static void main(String[] args) {
        OutClass outClass=new OutClass();
        OutClass.InnerClass innerClass=outClass.new InnerClass();
        //OutClass.InnerClass innerClass1=new OutClass().new InnerClass();
        innerClass.textInner();

    }
}
